package operators

import "fmt"

func DemoUnaryOperator() {
	re := 1 & 1
	fmt.Println("&: ", re)

	re = 1 & 0
	fmt.Println("&: ", re)

	re = 0 & 1
	fmt.Println("&: ", re)

	re = 0 & 0
	fmt.Println("&: ", re)

	fmt.Println("--- --- --- --- ---")
	// 按位与 |

	re = 1 | 1
	fmt.Println("|: ", re)

	re = 1 | 0
	fmt.Println("|: ", re)

	re = 0 | 1
	fmt.Println("|: ", re)

	re = 0 | 0
	fmt.Println("|: ", re)

	fmt.Println("--- --- --- --- ---")

	re = 1 ^ 1
	fmt.Println("1 ^ 1: ", re)

	re = 1 ^ 0
	fmt.Println("1 ^ 0: ", re)

	re = 0 ^ 1
	fmt.Println("0 ^ 1: ", re)

	re = 0 ^ 0
	fmt.Println("0 ^ 0: ", re)

}
